﻿using System;
using System.Collections.Generic;
using System.Text;
using HAVNet.Core;


namespace HAVNet.Intros.AST
{
    public class ASTMemberDeclPropertyI : ASTMemberDeclI
    {
        ASTAccessorInterfaces _accessors = null;

        public ASTType  type    { get; set; }
        public string   ident   { get; set; }
        public ASTAccessorInterfaces accessors { get { if (null == _accessors) _accessors = new ASTAccessorInterfaces(); return _accessors; } }

        public override string ToString()
        {
            string sMods = "";
            if (Mods.has(modifiers, Mods.newMod     )) sMods += "new ";
            if (Mods.has(modifiers, Mods.unsafeMod  )) sMods += "unsafe ";

            return
                Lazy.toStringNN(_attrGroups, "", Environment.NewLine) +
                sMods   +
                type.ToString() + " " +
                ident   + 
                " { "   +  
                accessors.ToString() + 
                " }" + Environment.NewLine;
        }
    }
}
